import * as types from './action-types';
export default {
    increment(){
        return {type:types.INCREMENT};
    },
    thunkIncrement(){
        //thunk的功能太弱，无法对执行流程进行精细控制 
        return function(dispatch,getState){
            setTimeout(function(){
                dispatch({type:types.INCREMENT});
            },1000);
        }
    },
    sagaIncrement(){
        return {type:types.INCREMENT_SAGA};
    },
    login(username,password){
        //payload
        return {type:types.LOGIN_REQUEST,username,password};
    },
    logout(){
        return {type:types.LOGOUT};
    },
    start(){
        return {type:types.START};
    },
    stop(){
        return {type:types.STOP};
    }
}